var app = getApp();
var https = "https://www.moreclub.cn/";
var http1 = 'http://10.150.7.248:8001/';
var http2 = 'http://59.110.53.149:8088/'
var showbox=true
var idn1;
var into = false

Page({
  data:{

  },
  onLoad:function(){
    var that=this;
    idn1 = wx.getStorageSync('idn1')
    var cityId = wx.getStorageSync('cityId');
    var access_token = wx.getStorageSync('inToken');

    if (idn1) {
      that.setData({
        idn1: idn1
      })
    }

    wx.request({
      url: https + 'v3/prefeer/open/topics?city=2',
      //url: 'http://59.110.53.149:8088/v3/prefeer/open/topics?city=2',
      success:function(res){
        console.log(res)
        var resData = res.data.data
        that.setData({
          resData: resData,
          showbox:true,
          into:into
        })
      }
    })
  },
  switchMark: function (e) {
    var that = this
    idn1 = e.currentTarget.dataset.idn
    try {
      wx.setStorageSync('idn1', idn1)
    } catch (e) {
    }
    var huati= e.currentTarget.dataset.name
    var tidtxt = e.currentTarget.dataset.tid
    that.setData({
      idn1: idn1,
      showbox: false,
      into:into
    })
    app.globalData.huati = huati
    app.globalData.tidtxt = tidtxt
    wx.navigateBack({
      delta: 1
    })
    into = true
  },
  switchNone: function () {
    var that = this
    idn1 = -1
    try {
      wx.setStorageSync('idn1', idn1)
    } catch (e) {
    }
    that.setData({
      showbox: true,
      idn1: -1,
      into:into
    })
    app.globalData.huati = '不使用话题'
    app.globalData.tidtxt = '0'
    wx.navigateBack({
      delta: 1
    })
    into = true
  },
})
